<%@ page contentType="text/html;charset=UTF-8" language="java" %> 
<%@ page import="java.util.List" %> 
<%@ page import="javax.jdo.PersistenceManager" %> 
<%@ page import="com.google.appengine.api.users.User" %> 
<%@ page import="com.google.appengine.api.users.UserService" %> 
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %> 
<%@ page import="orm.Stock" %> 
<%@ page import="orm.PMF" %> 
 

<%@page import="java.util.Date"%>
<%@page import="util.DateUtil"%>

<%@page import="javax.jdo.Query"%><html> 
<head>
	<link type="text/css" rel="stylesheet" href="/stylesheets/main.css" />
</head>
<body> 
<form action="/admin/initStockData" method="post">
 <div>股票代码：<textarea name="content" rows="20" cols="80"></textarea></div>
 <div><input type="submit" value="保存" /></div> 
</form> 
 
<% 
    PersistenceManager pm = PMF.get().getPersistenceManager(); 
	Query query = pm.newQuery(Stock.class);
	query.setOrdering("gmtCreate desc");
	query.setRange(0, 1000);
    List<Stock> stocks = (List<Stock>) query.execute(); 
    if (stocks.isEmpty()) { 
%> 
<p>没有股票信息.</p> 
<% 
    } else { 
        for (Stock s : stocks) { 
%> 
<p><b><%= s.getName() %>(<%= s.getCode() %>)</b></p>
<% 
		} 
    } 
    pm.close(); 
%> 
 
  </body> 
</html>